Skip to content

Conversation

@grcevski
Copy link
Contributor

This PR adds OBI documentation on how the parent child correlation works for different technologies, for the purpose of context propagation.

Relates to open-telemetry/opentelemetry-ebpf-instrumentation#903

@otelbot-docs otelbot-docs bot requested a review from a team November 25, 2025 20:25
@grcevski grcevski changed the title Initial write-up of context propagation techniques in OBI Write-up of context propagation techniques in OBI Nov 25, 2025
Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really useful, and I think starting with this scope is good.

I'm imagining that users will probably come to this page with questions like "will this work with my java Spring Boot application?" (my google search suggests it might work with Spring MVC, but not with Spring WebFlux, which is reactive, or Java Virtual Threads...). With some digging I think people can use what you've written to answer their question here (e.g. is my framework reactive?). But I also think that the more we can enumerate popular examples of things that will work, or popular examples of things that won't work, the fewer user questions we will get.

At a time of an outgoing client request, we use the parent to child relationship map, up to a depth of 3,
to lookup any, still active, incoming request that has launched the outgoing request goroutine.

Special consideration is taken for correct context propagation for `gRPC`, because the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you already implement the "metadata injection" portion of context propagation for gRPC, or is this referring to go auto-instrumentation? Out of curiosity, are languages below not supported because we haven't implemented it yet, or because the approach used in Go won't work in those languages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were just discussing this part at the SIG, so I'll summarise here. What we have for Go gRPC at the moment is using the bpf_probe_write_user helper, which is banned on locked kernels and it's Go specific. We have new design that will use the same approach as for HTTP and implement this for all languages. We need to change a few internal data structures to hold the streamID, since it's no longer a simple connection based key.


## What doesn't work

- Any reactive programming frameworks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the phrasing of "applications that do FOO, such as reactive frameworks" you use below, since it helps me understand what it is doing that OBI can't track. Some popular examples might also be helpful.

- `.net` `async`/`await` create number of complex thread pools that are unpredictable
in how the work is scheduled.

## Future work
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably exclude this from the website, since it is speculative.


`nginx` correlation doesn't for for `HTTP2`/`gRPC`.

### Generic approach
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call this language-agnostic?

Comment on lines +95 to +98
by the same thread. It detects if multiple current outgoing requests are handled by
the same thread and marks the correlation information as invalid. This helps us
prevent incorrect correlation, when the application framework handles multiple
connections on the same thread.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 that was my biggest question for asyncio, if OBI would generate incorrect parent-child relationships

@grcevski
Copy link
Contributor Author

This is really useful, and I think starting with this scope is good.

I'm imagining that users will probably come to this page with questions like "will this work with my java Spring Boot application?" (my google search suggests it might work with Spring MVC, but not with Spring WebFlux, which is reactive, or Java Virtual Threads...). With some digging I think people can use what you've written to answer their question here (e.g. is my framework reactive?). But I also think that the more we can enumerate popular examples of things that will work, or popular examples of things that won't work, the fewer user questions we will get.

Good point. I'll try to make a list of examples which work and which don't for the various programming languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants